package com.xyq.controller;

import com.xqy.pojo.User;
import com.xyq.feign.FeignClientUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
public class UserController {
    @Autowired
    private FeignClientUserService feignClientUserService;
    @GetMapping("/cs/get")
    public User getUser(Integer userId){
       return feignClientUserService.getUser(userId);
    }
    @GetMapping("/cs/list")
    public List<User> getUserList(){
        System.out.println("feign_consumer.list");
        return feignClientUserService.queryList();
    }
    @GetMapping("/cs/test")
    public String  getTest(){
        System.out.println("feign_consumer.test");
        return feignClientUserService.getTest();
    }
}
